#!/bin/bash

base_dir=$(dirname `pwd`)
flume_dir=$(dirname `pwd`)

EXTRA_ARGS=${EXTRA_ARGS-'-name server'}
JAVA_DEBUG="false"

COMMAND=$1
case $COMMAND in
  -daemon)
    EXTRA_ARGS="-daemon "$EXTRA_ARGS
    shift
    ;;
  -debug)
    JAVA_DEBUG="true"
    shift
    ;;
  *)
    ;;
esac

export JAVA_DEBUG
export JAVA_HEAP_OPTS="-Xms512M -Xmx1024M -Dflume.app.dir=$flume_dir"
export CLASSPATH_CONF="$base_dir/conf"

exec `pwd`/run-class.sh $EXTRA_ARGS com.syher.dubbo.provider.SpringBootDubboProviderApplication "$@"
